
class JunitService:
    @staticmethod
    def profile(junit_id):
        """
        返回:
        {
            tests:
            failures:
            skipped:
            duration:
        }
        """
        return {
            'tests': 1,
            'failures': 2,
            'skipped': 3,
            'duration': 4,
        }
    
    @staticmethod
    def packages_profile(junit_id):
        """
        返回:
        [
            {
                package:
                tests:
                failures:
                skipped:
                duration:	
            }
        ]
        """
        return [
            {
                'package': 'main',
                'tests': 4,
                'failures': 3,
                'skipped': 2,
                'duration': 1,
            }
        ]
    
    @staticmethod
    def classes_profile(junit_id,package_name = None):
        """
        返回:
        [
            {
                class:
                tests:
                failures:
                skipped:
                duration:	
            }
        ]
        """
        return [
            {
                'class': 'main.Main',
                'tests': 4,
                'failures': 3,
                'skipped': 2,
                'duration': 1,
            }
        ]
    
    @staticmethod
    def package_profile(junit_id,package_name):
        """
        返回:
        {
            tests:
            failures:
            skipped:
            duration:
        }
        """
        return {
            'tests': 10,
            'failures': 20,
            'skipped': 30,
            'duration': 40,
        }
    
    @staticmethod
    def class_profile(junit_id,package_name,class_name):
        """
        返回:
        {
            tests:
            failures:
            skipped:
            duration:
        }
        """
        return {
            'tests': 11,
            'failures': 21,
            'skipped': 31,
            'duration': 41,
        }

    @staticmethod
    def tests_profile(junit_id,package_name,class_name):
        """
        返回:
        [
           {
                test:
                duration:
                result:
            } 
        ]
        """
        return [
            {
                'test': 'main.Main.test1',
                'duration': 10,
                'result': 'success'
            }
        ]